﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.ManageInformation;

public partial class ChangePassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (!WebStudent.Validate(CardID_TextBox.Text, OldPassword_TextBox.Text))
            {
                Response.Write("<script>alert('原密码错误!')</script>");
                return;
            }
            if (WebStudent.ChangePassword(CardID_TextBox.Text, Password_TextBox.Text))
            {
                Response.Write("<script>alert('修改成功!')</script>");
            }
            else
            {
                Response.Write("<script>alert('修改失败!')</script>");
            }
        }
    }
}